<?php
class Useradmin_Data_Removeaction {
	
	private $secure;
	private $database;
	
	public function __construct(){
		$this->database = new Core_Driver_MysqlImproved;
		$this->secure = new Core_Data_Secure;
	}
	
	public function removeUser(array $getVars){
		
		$getVars = $this->secure->parseData($getVars);
		
		$userEmail = $getVars['username'];
		
		$this->database->connect();
		$userEmail = $this->database->escape($userEmail);
		$this->database->prepare(
			"delete from users where users_email = '$userEmail';"
		);
		$this->database->query();
		$this->database->dataOperations();
		echo '<meta http-equiv="Refresh" content="0;url='.SERVER_ROOT.'?useradmin">';
	}
}